package com.hackerrank.challenges.hyperstrings;

import java.util.Scanner;

public class Solution {
	private static final int MAX = 1000000007;
	private static int numHyperStrings(String H[], int M, int NHS[]) {
		if(NHS[M] >= 0)
			return NHS[M];
		NHS[M] = 1;
		for(String HS : H) {
			if(HS.length() <= M)
				NHS[M] = (NHS[M] + numHyperStrings(H, M - HS.length(), NHS)) % MAX;
		}
		return NHS[M];
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt(), M = in.nextInt(), NHS[] = new int[M + 1];
		in.nextLine();
		String H[] = new String[N];
		for(int i = 0; i < N; i++)
			H[i] = in.nextLine();
		NHS[0] = 1;
		for(int i = 1; i <= M; i++)
			NHS[i] = -1;
		System.out.println(numHyperStrings(H, M, NHS));
	}
}
